{{#partial title}}Rust China{{/partial}}
{{#partial page}}
  <div class="container">
    <div class="row">
      <div class="col-md-9">
          <div class="panel panel-default">
              <div class="panel-heading panel-heading-no-padding">
                  <ul class="nav nav-pills">
                      <li role="presentation" class="{{#if index}}active{{/if}}"><a href="/">全部</a></li>
                      {{#each categories}}
                          <li role="presentation" class="{{#if active}}active{{/if}}"><a href="/category/{{value}}">{{title}}</a></li>
                      {{/each}}
                  </ul>
              </div>
              <ul class="list-group">
                  {{#each articles}}
                      <li class="media list-group-item">
                          <div class="media-left">
                              <a href="/user/{{user.id}}">
                                  <img class="media-object img-circle" src="{{ user.avatar }}" style="width:48px;height:48px;">
                              </a>
                          </div>
                          <div class="media-body" id="post-list">
                              <h4 class="media-heading">
                                  {{#if is_top}}
                                      <span class="label label-top">置顶</span>
                                  {{/if}}
                                  {{#if is_essence}}
                                      <span class="label label-essence">精华</span>
                                  {{/if}}
                                  <a href="/article/{{id}}">{{title}}</a>
                              </h4>
                              <h5 class="media-heading">
                                  <small>
                                      <a href="/category/{{category.value}}">{{category.title}}</a>
                                      •
                                      <a href="/user/{{user.id}}">{{user.username}}</a>
                                      •
                                      <span class="time-label" date-time="{{update_time}}"></span>
                                  </small>
                              </h5>
                          </div>
                          <div class="media-right media-middle">
                              {{#if comments_count}}
                                  <h4><span class="label label-inverted label-primary">{{comments_count}}</span></h4>
                              {{else}}
                                  <h4><span class="label comment-none">{{comments_count}}</span></h4>
                              {{/if}}
                          </div>
                      </li>
                  {{/each}}
              </ul>

              {{#if show_pagination}}
                  <ul class="pagination">
                      <li>
                          <a href="{{#if index}}/{{else}}/category/{{category}}{{/if}}?page={{previous_page}}" aria-label="Previous">
                              <span aria-hidden="true">上一页</span>
                          </a>
                      </li>
                      {{#each pages}}
                      <li class="{{#if active}}active{{/if}}"><a href="{{#if ../../index}}/{{else}}/category/{{../../category}}{{/if}}?page={{page}}">{{page}}</a></li>
                      {{/each}}
                      <li>
                          <a href="{{#if index}}/{{else}}/category/{{category}}{{/if}}?page={{next_page}}" aria-label="Next">
                              <span aria-hidden="true">下一页</span>
                          </a>
                      </li>
                  </ul>
              {{/if}}
          </div>
      </div>
      <div class="col-md-3">
          {{#if login_user}}
              {{~> new_article_btn ~}}
          {{/if}}
          {{#if unread_messages_count}}
              <div class="panel panel-default">
                  <div class="panel-body new-massage">
                      <a href="/user/{{login_user.id}}/messages">未读消息 <span class="red badge">{{unread_messages_count}}</span></a>
                  </div>
              </div>
          {{/if}}
          {{~> friends ~}}
          {{~> stat ~}}
      </div>
    </div>
  </div>
{{/partial}}
{{#partial footer_js}}
    <script>
    </script>
{{/partial}}
{{~> base~}}
